package com.yuhao.client.feignclient;

import com.yuhao.common.entity.serviceb.ServiceBOutput;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

/** 服务降级跳入 ServiceClientFallback类中返回null */
@FeignClient(name = "serviceb", fallback = ServiceBClient.ServiceClientFallback.class)
@Service
public interface ServiceBClient {

    @GetMapping("/serviceb/feignFindAllTest")
    List<ServiceBOutput> getServicebList();

    @Component
    static class ServiceClientFallback implements ServiceBClient {

        @Override
        public List<ServiceBOutput> getServicebList() {
            return null;
        }
    }
}
